import $service from '../../../../service.js';
var prescription_id;
const app = getApp();
Page({
    data: {
        "active": true,
        prescriptionMap: {},
        doctorMap: {},
        inquiryMap: {},
        prescriptionlist: [],
        tipMessageList: {
            chMedicine: ["一般病症每日服一剂，每剂二煎或三煎，分两次（早、晚各1次）送服或三次（早、中、晚各1次）送服，每次服用约200ml。急症、高热和危重病人酌情每日2~3剂或遵医嘱。", "用法请遵循医嘱"],
            weMedicine: ["一般可用白开水送服，特殊送服方法请遵循医嘱。祝您早日康复！", "用法请参考药品说明书或遵循医嘱！"]
        }
    },
    onLoad(e) {
        prescription_id = e.prescription_id
    },
    onShow() {
        this.getInterrogationDrugList();
        this.editorPrescription();
    },
    editorPrescription() {
        app.http.editorPrescription({
            id: prescription_id
        }).then(res => {
            console.log(res)
            this.setData({
                prescriptionMap: res.data
            })
        })
    },
    getInterrogationDrugList() {
        app.http.getPrescriptionDrugDetail({
            id: prescription_id
        }).then(res => {
            this.setData({
                prescriptionlist: res.data.prescriptionDrugListResps
            })
        }).catch(err => {
            $service.showToast(err.msg)
        })
    },
})